//
//  NetConfig.swift
//  ZJProject
//
//  Created by HyBoard on 2019/7/12.
//  Copyright © 2019 HyBoard. All rights reserved.
//

import UIKit
import Moya
import RxSwift

enum APIService {
    case news
}

let base_url = "http://m.zhangjiaqian.top/"


extension APIService: TargetType {
    var baseURL: URL {
        return URL(string: base_url)!
    }
    
    var path: String {
        switch self {
        case .news:
            return "home/news.php"
//        default:
//            return ""
        }
    }
    
    var method: Moya.Method {
        return .get
    }
    
    var sampleData: Data {
        return "".data(using: String.Encoding.utf8)!
    }
    
    var task: Task {
        return .requestPlain
    }
    
    var headers: [String : String]? {
        return nil
    }
    
    
}
